package com.example.bangbangxia.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;
import java.util.List;


@Data
@TableName("user")
public class User {
    @TableId(value ="user_id",type = IdType.AUTO) //自增
    private int userId;

    @TableField("user_name")
    private String userName;

    @TableField("user_password")
    private String userPassword;

    @TableField("user_phone")
    private String userPhone;

    @TableField("user_email")
    private String userEmail;//邮箱

    @TableField(value = "user_token")
    private String userToken;//记录登陆标记的token

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime;//创建时间

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;//创建时间

    @TableField("user_headpic")
    private String userHeadPic;//头像的url

    @TableField("user_sex")
    private String userSex;//性别：1表示男，0表示女

    @TableField("user_city")
    private String userCity;

    @TableField(exist = false)//表示不该属性不是数据库字段，但又必须使用
    private List<Task> taskList;
}
